package model

import (
	"gorm.io/gorm"
)

type Shop struct {
	gorm.Model
	Name   string
	Price  float64
	Number int
	UserId int
}

func (s *Shop) ShopList(db *gorm.DB) []Shop {
	var shops []Shop
	err := db.Model(Shop{}).Find(&shops).Error
	if err != nil {
		panic(err)
	}
	return shops
}
